# -*- coding: utf-8 -*-
# @Time     : 2021/11/30 21:01
# @Author   : wljess
# @File     : 验证进程间数据隔离.py
# @Describe : 
# @Software : PyCharm

from multiprocessing import Process

num = 100


def func(n):
    global num
    num -= 1
    print(f"子进程{n}中的：{num}")


if __name__ == '__main__':
    lst_p = []
    for i in range(10):
        p = Process(target=func, args=(i, ))
        p.start()
        lst_p.append(p)

    for p in lst_p:
        p.join()

    print(f"主进程中的：{num}")
